<template>
  <div>
    <!-- 商品导航 -->
    <TypeNav />
    <!-- 列表 -->
    <ListContainer />
    <!-- 今日推荐 -->
    <Recommand />
    <!-- 商品排行 -->
    <Rank />
    <!-- 猜你喜欢 -->
    <Like />
    <!--楼层-->
    <Floor v-for="(list, index) in floorList" :key="index" :lists="list"/>
    <!--商标-->
    <Brand />
  </div>
</template>

<script>
//引入路由组件
import ListContainer from "./ListContainer";
import Recommand from "./Recommand";
import Rank from "./Rank";
import Like from "./Like";
import Floor from "./Floor";
import Brand from "./Brand";
//引入floor组件需要的数据
import {mapState} from 'vuex'

export default {
  name: "Home",
  components: {
    ListContainer,
    Recommand,
    Rank,
    Like,
    Floor,
    Brand,
  },
  mounted() {
    //获取floor信息
    this.$store.dispatch('floorList')
    //获取用户信息
    this.$store.dispatch('userInfo')
  },
  computed: {
    ...mapState({
      floorList:state=>state.home.floorList
    })
  }
};
</script>

<style>
</style>